package com.gxgy.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class MymvcConfig implements WebMvcConfigurer{
	
	//视图跳转
	@Override
	public void addViewControllers(ViewControllerRegistry registry) {
		registry.addViewController("/").setViewName("page/login");
		registry.addViewController("index").setViewName("page/welcome");
	}
	
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new LoginHandlerinterceptor())
		.addPathPatterns("/**").excludePathPatterns("/","login","/doLogin","/register","/doRegister","/registerInfo","/css/*"
				,"/js/**","/images/**","/api/**","/lib/**","/dist/**","/vue/**");
	

	}
}